package _15_Constructors;

public class Person1 
{
	public String name;
	long personalNumber;
	public int age;
	String number;
	double weight;
	boolean isMale;
	Person1 [] friends;
	double money = 100;
	Car1 car;

	Person1()
	{
		age = 0;
		weight = 4.0;
	}
	Person1(String name, long personalNumber, boolean isMale)
	{
		this();
		this.name = name;
		this.personalNumber = personalNumber;
		this.isMale = isMale;
		
		this.friends = new Person1[3];
		
		
	}
	public void printPersonParams()
	{
		System.out.println("Name is: " + name);
		System.out.println("Age is: " + age);
		System.out.println("Personal number is: " + personalNumber);
		System.out.println("Is male: " + isMale);
	}
	
	public boolean buyCar(Car1 car)
	{
		if(this.money > car.price)
		{
			this.car = car;
			car.changeOwner(this);
			return true;
		}
		else
		{
			return false;
		}
	}
	double sellCarForScrap()
	{
		double metalPrice = 30.00;
		this.money += metalPrice;
		return money;
		
	}
	
	
}
